<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>Bungalow Apps</title>
</head>
<body>
<h1><span style="font-weight: bold;">Bungalow
Apps API</span></h1>
<span style="font-style: italic;"><br>
This documentation is still under progress. Much of the framework is
the same as Spotify apps, so see the Spotify official docs at <br>
https://developer.spotify.com/technologies/apps/guidelines/. The core
is the same, with the spotify: namespace is bungalow: and resource
protocol sp is bl.<br>
</span><span style="font-style: italic;"></span>
<h2>Introduction</h2>
Bungalow is a generic HTML5 App platform that is based on the
application infrastucture used
by Spotify Apps. Bugnalow will in some ratio be able to read and
execute Spotify Apps, but that will be held for an experimental one.<br>
<br>
<h2>Getting started</h2>
All apps is stored in the ~/My Documents/Bungalow/$IDENTIFIER folder.
The app
skeleton is following:
<h3>Predefined files</h3>
<div class="itemizedlist">
<ul>
  <li>Index.html - The base app's
layout</li>
  <li>manifest.json - The
application's manifest.json</li>
  <li>header.html - The
application header bar</li>
  <li>footer.html - The
application's footer</li>
</ul>
<h2>Resource structure</h2>
The Bungalow HTML5 apps is using a shared resources through the url
protocol bl://. It are relative to the app directories where the first
level directory is the certain app domain. These URLs can be accessed
from any URL enabled eleemnts. <br>
<br>
<span style="font-style: italic;">Bungalow
can also use sp:// resource path to make Spotify Apps compatible.</span><br>
<h3>Shared resource structure</h3>
The root folder import bl://import/ is a special directory which holds
fundamental stuff that Bungalow Apps uses to carry out various aspects
of the framework. <br>
<br>
<h2></h2>
<h2></h2>
<h2>Manifest</h2>
<span style="font-style: italic;">This
section is based on the app
guidelines at Spotify </span><a
 href="https://developer.spotify.com/technologies/apps/guidelines/">https://developer.spotify.com/technologies/apps/guidelines/</a>
The App manifest, manifest.json, located in $APPDIR\\manifest.json
defines the behaviour of the app.<br>
<br>

<br>
<h2>Permissions</h2>
The manifest must specify the domains where it fetch it's dynamic data.<br>
<br>
<br>
<h2>MVC</h2>
Bungalow comes with a Model View Controller system. The HTML5 pages is
the controllers and the models and views are defined in JavaScript. To
access these stuff, you must import it from a Bungalow object accessed
by the function getBungalowApi(). <br>
<br>
<code>
var api = getBungalowApi(1);
<br>
function init() {<br>
&nbsp;&nbsp;&nbsp; var models =
api.require("bl://import/scripts/api/models");
<br>
&nbsp;&nbsp;&nbsp; var views =
api.require("bl://import/scripts/api/views");<br>
}<br>
</code><br>
<br>
<h2>Views</h2>
Location: bl://import/scripts/api/views<br>
Bungalow apps is often creating series of common items like articles,
playlists, images and other kind of views. In traditional html apps,
developer have to do a rough task of &nbsp;creating and appending
elements and setting properties. In Bungalow, we use Spotify Apis
mechanism of Views, which are JavaScript objects whose instance that
can be tweaked and then be attached to the main page by a property
called 'node'. It has the following definition:<br>
<br>
<code>
interface View {
<br>
&nbsp;&nbsp;&nbsp; property readonly node;<br>
&nbsp;&nbsp;&nbsp; [properties related to the specific type]<br>
}<br>
<br>
</code>
Several common elements are implementation of the View interface. Among
these is<br>
<br>
<br>
<span style="font-weight: bold;"><br>
</span>
<h2>Models</h2>
Location: bl://import/scripts/api/models<br>
dddd<br>
<br>
<br>
<br>
<br>
<br>
</div>
The
Bungalow Framework has defined several interfaces that are delegating
much of the fundamental mechanisms behind the scenes.. The core
interfaces is:<br>
<br>
<br>
</body>
</html>
